import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      children: [
        {
          path: '',
          name: 'home',
          component: () => import('@/views/home/index.vue')
        },
        {
          path: '/problem',
          name: 'problem',
          component: () => import('@/views/problem/index.vue')
        },
        {
          path: '/training',
          name: 'training',
          component: () => import('@/views/training/index.vue')
        },
        {
          path: '/contest',
          name: 'contest',
          component: () => import('@/views/contest/index.vue')
        },
        {
          path: '/status',
          name: 'status',
          component: () => import('@/views/status/index.vue')
        },
        {
          path: '/rank',
          name: 'rank',
          component: () => import('@/views/rank/index.vue')
        },
        {
          path: '/discussion',
          name: 'discussion',
          component: () => import('@/views/discussion/index.vue')
        },
        {
          path: '/group',
          name: 'group',
          component: () => import('@/views/group/index.vue')
        },
        {
          path: '/about',
          name: 'about',
          component: () => import('@/views/about/index.vue')
        }
      ]
    }
  ]
})

export default router
